import withRouter from 'umi/withRouter';
import { TransitionGroup, CSSTransition } from "react-transition-group";

export default withRouter(
  ({ location }) =>
    <TransitionGroup>
      <CSSTransition key={location.pathname} classNames="fade" timeout={300}>
        { this.props.children }
      </CSSTransition>
    </TransitionGroup>
)

// .fade-enter {
//   opacity: 0;
//   z-index: 1;
// }

// .fade-enter.fade-enter-active {
//   opacity: 1;
//   transition: opacity 250ms ease-in;
// }